Skip to content

store: spent-range from RAM n_out only - #477

Closed
rearden-grok[bot] wants to merge 1 commit into
masterfrom
store/spent-ram-nout
Closed

store: spent-range from RAM n_out only#477
rearden-grok[bot] wants to merge 1 commit into
masterfrom
store/spent-ram-nout

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Schema 21 dropped spent.idx and reconstructed spent.body (off,len) by preading txout.body windows for n_out. That is the IBD wave spent= blow-up vs 0.5.99.
  • Class A already knows n_out at append. Keep it in RAM. tx_spent_range* prefix-sums that vec from spent.off checkpoints and never reads txout.body. Missing n_out is Corrupt("invariant: spent n_out missing").
  • Open hydrates the vec from LAYOUT17 meta once (same-context read of n_out). IBD lookup/write stay off the body.

Test plan

  • spent_range_uses_append_n_out_not_txout_body — truncate txout.body after append; ranges still match
  • class_a_append_does_not_write_spent_idx / open_unlinks_leftover_spent_idx (reopen hydrate)
  • required CI green

Made with Cursor

Lookup was reconstructing spent.body (off,len) by preading txout.body
to recover n_out. Class A already has n_out at append; keep that vec
and make tx_spent_range* fail closed if it is missing instead of
walking the body.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rearden-grok

rearden-grok Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #484 (schema 22 restores spent.idx + vin pack; do not land process-lifetime n_out[]).

@rearden-grok
rearden-grok Bot deleted the store/spent-ram-nout branch September 13, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant